/*
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
//vector<int> cube;
vector< vector<int> > cube(6, vector<int>(4,0));
vector<int> tempCubeRotateVec(4,0);
int tempCubeRotateValue;
const int CUBE_CENTER = 0, CUBE_LEFT= 1, CUBE_RIGHT = 2, CUBE_UP = 3, CUBE_DOWN = 4, CUBE_BACK = 5;

void rotateCube(int dir){
	if(dir == CUBE_LEFT){
		
		//Right becomes back, top and bottom change their left right and such		
		tempCubeRotateVec = cube[CUBE_CENTER];
		cube[CUBE_CENTER]=cube[CUBE_LEFT];
		cube[CUBE_LEFT]=cube[CUBE_BACK];
		cube[CUBE_BACK]=cube[CUBE_RIGHT];
		cube[CUBE_RIGHT] = tempCubeRotateVec;
		
		//now we need to rotate the up side	
		tempCubeRotateValue = cube[CUBE_UP][0];
		cube[CUBE_UP][0] = cube[CUBE_UP][2];
		cube[CUBE_UP][2] = cube[CUBE_UP][1];
		cube[CUBE_UP][1] = cube[CUBE_UP][3];
		cube[CUBE_UP][3] = tempCubeRotateValue;
		
		// and down side
		tempCubeRotateValue = cube[CUBE_DOWN][0];
		cube[CUBE_DOWN][0] = cube[CUBE_DOWN][3];
		cube[CUBE_DOWN][3] = cube[CUBE_DOWN][1];
		cube[CUBE_DOWN][1] = cube[CUBE_DOWN][2];
		cube[CUBE_DOWN][2] = tempCubeRotateValue;
	}
	else if(dir == CUBE_RIGHT){
		
		//Left becomes back, top and bottom change their left right and such		
		tempCubeRotateVec = cube[CUBE_CENTER];
		cube[CUBE_CENTER]=cube[CUBE_RIGHT];
		cube[CUBE_RIGHT] =cube[CUBE_BACK];		
		cube[CUBE_BACK] = cube[CUBE_LEFT];
		cube[CUBE_LEFT] =  tempCubeRotateVec;
		
		//now we need to rotate the up side	
		tempCubeRotateValue = cube[CUBE_UP][0];
		cube[CUBE_UP][0] = cube[CUBE_UP][3];
		cube[CUBE_UP][3] = cube[CUBE_UP][1];
		cube[CUBE_UP][1] = cube[CUBE_UP][2];
		cube[CUBE_UP][2] = tempCubeRotateValue;
		
		// and down side
		tempCubeRotateValue = cube[CUBE_DOWN][0];
		cube[CUBE_DOWN][0] = cube[CUBE_DOWN][2];
		cube[CUBE_DOWN][2] = cube[CUBE_DOWN][1];
		cube[CUBE_DOWN][1] = cube[CUBE_DOWN][3];
		cube[CUBE_DOWN][3] = tempCubeRotateValue;
	}

	else if(dir == CUBE_UP){
		
		//Current becomes bo
		//Left becomes back, top and bottom change their left right and such		
		tempCubeRotateVec = cube[CUBE_CENTER];
		cube[CUBE_CENTER]=cube[CUBE_UP];
		cube[CUBE_UP] =cube[CUBE_BACK];		
		cube[CUBE_BACK] = cube[CUBE_DOWN];
		cube[CUBE_DOWN] =  tempCubeRotateVec;
		
		//now we need rearrange up
		tempCubeRotateValue = cube[CUBE_UP][0];
		cube[CUBE_UP][0] = cube[CUBE_UP][1];
		cube[CUBE_UP][1] = tempCubeRotateValue;
		tempCubeRotateValue = cube[CUBE_UP][3];
		cube[CUBE_UP][3] = cube[CUBE_UP][2];
		cube[CUBE_UP][2] = tempCubeRotateValue;

		//now we need rearrange back
		tempCubeRotateValue = cube[CUBE_BACK][0];
		cube[CUBE_BACK][0] = cube[CUBE_BACK][1];
		cube[CUBE_BACK][1] = tempCubeRotateValue;
		tempCubeRotateValue = cube[CUBE_BACK][3];
		cube[CUBE_BACK][3] = cube[CUBE_BACK][2];
		cube[CUBE_BACK][2] = tempCubeRotateValue;

		//now we need to rotate the left side	
		tempCubeRotateValue = cube[CUBE_LEFT][0];
		cube[CUBE_LEFT][0] = cube[CUBE_LEFT][3];
		cube[CUBE_LEFT][3] = cube[CUBE_LEFT][1];
		cube[CUBE_LEFT][1] = cube[CUBE_LEFT][2];
		cube[CUBE_LEFT][2] = tempCubeRotateValue;
		
		// and right side
		tempCubeRotateValue = cube[CUBE_RIGHT][0];
		cube[CUBE_RIGHT][0] = cube[CUBE_RIGHT][2];
		cube[CUBE_RIGHT][2] = cube[CUBE_RIGHT][1];
		cube[CUBE_RIGHT][1] = cube[CUBE_RIGHT][3];
		cube[CUBE_RIGHT][3] = tempCubeRotateValue;
	}


	else if(dir == CUBE_DOWN){
		//Left becomes back, top and bottom change their left right and such		
		tempCubeRotateVec = cube[CUBE_CENTER];
		cube[CUBE_CENTER]=cube[CUBE_DOWN];
		cube[CUBE_DOWN] =  cube[CUBE_BACK];
		cube[CUBE_BACK] = cube[CUBE_UP];
		cube[CUBE_UP] =tempCubeRotateVec;
		

		//now we need rearrange down
		tempCubeRotateValue = cube[CUBE_DOWN][0];
		cube[CUBE_DOWN][0] = cube[CUBE_DOWN][1];
		cube[CUBE_DOWN][1] = tempCubeRotateValue;
		tempCubeRotateValue = cube[CUBE_DOWN][3];
		cube[CUBE_DOWN][3] = cube[CUBE_DOWN][2];
		cube[CUBE_DOWN][2] = tempCubeRotateValue;

		//now we need rearrange back
		tempCubeRotateValue = cube[CUBE_BACK][0];
		cube[CUBE_BACK][0] = cube[CUBE_BACK][1];
		cube[CUBE_BACK][1] = tempCubeRotateValue;
		tempCubeRotateValue = cube[CUBE_BACK][3];
		cube[CUBE_BACK][3] = cube[CUBE_BACK][2];
		cube[CUBE_BACK][2] = tempCubeRotateValue;

		//now we need to rotate the left side	
		tempCubeRotateValue = cube[CUBE_LEFT][0];
		cube[CUBE_LEFT][0] = cube[CUBE_LEFT][2];
		cube[CUBE_LEFT][2] = cube[CUBE_LEFT][1];
		cube[CUBE_LEFT][1] = cube[CUBE_LEFT][3];
		cube[CUBE_LEFT][3] = tempCubeRotateValue;

		// and right side
		tempCubeRotateValue = cube[CUBE_RIGHT][0];
		cube[CUBE_RIGHT][0] = cube[CUBE_RIGHT][3];
		cube[CUBE_RIGHT][3] = cube[CUBE_RIGHT][1];
		cube[CUBE_RIGHT][1] = cube[CUBE_RIGHT][2];
		cube[CUBE_RIGHT][2] = tempCubeRotateValue;
	}
}

int main() {
	// pushed in the order: LEFT RIGHT UP DOWN

	//Center - 1  	
	cube[0][0] = 3;
	cube[0][1] = 4;
	cube[0][2] = 2;
	cube[0][3] = 5;

	//Left - 3	
	cube[1][0] = 6;
	cube[1][1] = 1;
	cube[1][2] = 2;
	cube[1][3] = 5;

	//Right - 4
	cube[2][0] = 1;
	cube[2][1] = 6;
	cube[2][2] = 2;
	cube[2][3] = 5;

	//Up - 2
	cube[3][0] = 3;
	cube[3][1] = 4;
	cube[3][2] = 6;
	cube[3][3] = 1;

	//Down
	cube[4][0] = 3;
	cube[4][1] = 4;
	cube[4][2] = 1;
	cube[4][3] = 6;

	//Back
	cube[5][0] = 4;
	cube[5][1] = 3;
	cube[5][2] = 2;
	cube[5][3] = 5;

	rotateCube(CUBE_LEFT);
	rotateCube(CUBE_UP);
	rotateCube(CUBE_RIGHT);

	rotateCube(CUBE_LEFT);
	rotateCube(CUBE_DOWN);
	rotateCube(CUBE_RIGHT);

	for(int i=0;i<6;i++){
		printf("This is side number: %i \n",i+1);
		printf("Left: %i \n",cube[i][0]);
		printf("Rigt: %i \n",cube[i][1]);
		printf("Up  : %i \n",cube[i][2]);
		printf("Dwn : %i \n",cube[i][3]);
	}
}
*/